﻿<%@ Page Language="C#" MasterPageFile="~/design/Anonym.Master" AutoEventWireup="true"
    CodeFile="Vstupenky.aspx.cs" Inherits="Zadani09.Vstupenky" Title="Vstupenky" %>

<asp:Content ID="Content1" ContentPlaceHolderID="LoginPlaceholder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MenuPlaceholder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentVrchniPlaceholder" runat="server">
    <h2>
        Seznam vstupenek</h2>
    <asp:Label ID="InfoLabel" runat="server" Font-Bold="True" Font-Size="Small"></asp:Label>  
    <asp:GridView ID="GridView1" runat="server" 
    BackColor="LightGoldenrodYellow" BorderColor="Tan"
        BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None" Width="740px"
        AllowPaging="True" AutoGenerateColumns="False" 
        DataSourceID="ObjectDataSource1" DataKeyNames="IDUzivatel,IDVystava,Datum">
        <FooterStyle BackColor="Tan" />
        <Columns>
            <asp:BoundField DataField="IDVystava" HeaderText="ID Výstavy" 
                SortExpression="IDVystava" />
            <asp:BoundField DataField="Datum" HeaderText="Datum" 
                SortExpression="Datum" />
            <asp:BoundField DataField="PocetDeti" HeaderText="Počet dětí" 
                SortExpression="PocetDeti" />
            <asp:BoundField DataField="PocetDospeli" HeaderText="Počet dospělých" 
                SortExpression="PocetDospeli" />
            <asp:TemplateField HeaderText="Stav" SortExpression="Stav">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" 
                        Text='<%# (Eval("Stav").ToString() == "0" ? "rezervována" : Eval("Stav").ToString() == "1" ? "prodána" : "doručena") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Stav") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:CommandField DeleteText="Smaž" ShowDeleteButton="True">
                <ItemStyle Font-Bold="True" />
            </asp:CommandField>
            <asp:BoundField DataField="IDUzivatel" HeaderText="IDUzivatel" 
                SortExpression="IDUzivatel" Visible="False" />
        </Columns>
        <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
        <HeaderStyle BackColor="Tan" Font-Bold="True" />
        <AlternatingRowStyle BackColor="PaleGoldenrod" />
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="Zadani09.db.Vstupenka"
        DeleteMethod="smaz" OldValuesParameterFormatString="original_{0}"
        SelectMethod="ctiVstupenkyJednohoUzivatele" 
        TypeName="Zadani09.db.ODS.VstupenkaDataObject">
        <SelectParameters>
            <asp:SessionParameter Name="idUzivatel" SessionField="PRIHLASENY_UZIVATEL" 
                Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentSpodniPlaceholder" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="BottomPlaceholder" runat="server">
</asp:Content>
